package com.example.demo.entity;

import java.util.Date;

import javax.persistence.Entity;
/**
 * @author 陶国庆
 *售后部配件渠道录入名字 AccessoriesChannels--------》售后部配件渠道录入名字 AccessoriesChannels2
 */
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Entity
public class AccessoriesChannels2 {
	@Id
	@GeneratedValue
	@JsonIgnore			//作用是json序列化时将java bean中的一些属性忽略掉
	private Integer id;
	@ManyToOne
	private AccessoriesChannels accessoriesChannels;
	
	private String category;		//配件类别
	
	private Float markup;			//加价率
	/**
	 * 起始日期
	 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonIgnore
	private Date beginDate;
	/**
	 * 结束日期
	 */
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonIgnore
	private Date endDate;
	
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public AccessoriesChannels getAccessoriesChannels() {
		return accessoriesChannels;
	}
	public void setAccessoriesChannels(AccessoriesChannels accessoriesChannels) {
		this.accessoriesChannels = accessoriesChannels;
	}
	public String getCategory() {
		return category;
	}
	public void setCategory(String category) {
		this.category = category;
	}
	public Float getMarkup() {
		return markup;
	}
	public void setMarkup(Float markup) {
		this.markup = markup;
	}
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	
	@Autowired
	private Integer getAccessoriesChannelsId() {
		return accessoriesChannels==null?null:accessoriesChannels.getId();
	}
	
	@Autowired
	private String getName() {
		return accessoriesChannels==null?null:accessoriesChannels.getName();
	}
	
	
}
